package com.example.springbootdemo.service.serviceImp;

import com.example.springbootdemo.constant.RocketMQConstant;
import com.example.springbootdemo.service.RocketMQHandelService;
import com.example.springbootdemo.service.RocketService;
import org.apache.rocketmq.client.apis.ClientException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName: RocketServiceImpl
 * @Description:
 * @Author: TXW
 * @Date: 2025/7/22
 */

@Service
public class RocketServiceImpl implements RocketService {

    @Resource
    private RocketMQHandelService rocketMQHandelService;

    @Override
    public void sendNormalmsg() throws ClientException {

        for (int i = 0; i < 100; i++) {
            rocketMQHandelService.sendNormalMessage(RocketMQConstant.TOPIC, "tag", "生产数据" + i, new String[]{"key"});
        }
    }

    @Override
    public void sendPushConsumerMsg() throws ClientException {

    }
}
